﻿
namespace QAToolsAddin.Comparer {

    public enum XlRowMatch {
        Empty = 0,
        NoMatch = 1,
        FullMatch = 2,
        MatchWithDiff = 3,
    }

    public enum XlAlign {
        None = 0,
        Tables = 1,
        Columns = 2,
        Values = 3,
    }


    public class CellSetPair {
        public CellSet CellSetA;
        public CellSet CellSetB;
    }

    public class RowSetPair {
        public RowSet RowSetA;
        public RowSet RowSetB;
    }

    public class CellSet {
        public object[,] Data;
        public bool[,] Diff;
        public int RowLen;
        public int ColLen;

        public CellSet(int rowLen, int colLen, bool withDiff = true)
            : this(ExcelArray<object>.Create(rowLen, colLen)) {
        }

        public CellSet(object[,] data, bool withDiff = true) {
            RowLen = data.GetLength(0);
            ColLen = data.GetLength(1);
            Data = data;
            if (withDiff)
                Diff = ExcelArray<bool>.Create(RowLen, ColLen);
        }

    }

    public class RowSet : CellSet {
        public object[,] Titles;
        public XlRowMatch[] Match;

        public RowSet(int rowLen, int colLen)
            : this(ExcelArray<object>.Create(rowLen, colLen)) {
        }

        public RowSet(object[,] data)
            : base(data) {
            Match = ExcelArray<XlRowMatch>.Create(base.RowLen);
            Titles = ExcelArray<string>.Create(1, base.ColLen);
        }

    }

}
